#pragma once

#include "Model.h"

// Base view class
// will have fps tracking

class View
{
public:
	View( Model * const inModel );
	virtual ~View(void);

	virtual void Render() = 0;	// for rendering system
	virtual void OnRender() = 0; // for actual rendering game object. Should be called in Render() function

	// Drawing functions.. should be defined for target platform
	virtual void SetTxtColor( COLORREF color ) = 0;
	virtual void SetBkMode( int inMode ) = 0;
	virtual void SetBkColor( COLORREF color ) = 0;
	virtual void TxtOut( float fX , float fY , const TCHAR * pStr ) = 0;
	virtual void DrawTxt( float x1 , float y1 , float x2 , float y2 , const TCHAR * pStr ) = 0;
	virtual void DrawRct( float x1 , float y1 , float x2 , float y2 , COLORREF color ) = 0;

	inline float GetWidth	() const { return this->mfWidth	; }
	inline float GetHeight	() const { return this->mfHeight; }
protected:
	Model * const getModel() const;
	float doFPSCheck();

	float mfWidth	;
	float mfHeight	;
private:
	Model * const mpModel;

	// for FPS
	unsigned int muLastTick		;
	unsigned int muFrameCount	;
	float mfFPS;
};

